<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
    <style>
        .el-page-header__content{
            color: white;
            font-weight: bold;
        }
    </style>
</head>
<body>
<div id="app">
    <el-page-header style="background-color: #0095d7;
            color: white;line-height: 60px" @back="goBack" content="挂号">
    </el-page-header>
    <el-card style="width: 1000px;height: 800px;margin: 0 auto">
        <el-row gutter="30">
            <el-col :span="12">
                <div >
                <el-form label-width="80px">
                    <el-form-item label="患者姓名">
                        <el-input style="width: 200px" type="text" v-model="p.username"></el-input>
                    </el-form-item>
                    <el-form-item label="性别">
                        <el-select v-model="value4">
                            <el-option v-for="c in genderArr"
                                       :label="c.label" :value="c.value4"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="身份证号">
                        <el-input style="width: 200px"  type="text" v-model="p.saleCount"></el-input>
                    </el-form-item>
                    <el-form-item label="挂号科室">
                        <div class="block">
                            <el-cascader
                                    v-model="value"
                                    :options="options"
                                    :props="{ expandTrigger: 'hover' }"
                                    @change="handleChange"></el-cascader>
                        </div>
                    </el-form-item>

                </el-form>
            </div></el-col>
            <el-col :span="12">
                <div >
                    <el-form label-width="80px">
                        <div class="block">
                            <el-form-item label="出生日期">
                                <el-date-picker
                                        v-model="value1"
                                        type="date"
                                        placeholder="出生日期">
                                </el-date-picker>
                            </el-form-item>

                        </div>
                        <div class="block">
                            <el-form-item label="挂号日期">
                                <el-date-picker
                                        v-model="value2"
                                        type="date"
                                        placeholder="挂号日期">
                                </el-date-picker>
                            </el-form-item>

                        </div>

                        <el-form-item label="号别">
                            <el-select v-model="value5">
                                <el-option v-for="c in oldUrl"
                                           :label="c.label":value="c.value5" ></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="挂号费用">
                            <el-select v-model="p.categoryId">
                                <el-option v-for="c in reaistration"
                                           :label="c.label":value="c.value6"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="success" @click="insert()">挂号</el-button>
                        </el-form-item>
                    </el-form>
                </div></el-col>
        </el-row>



        </el-form>
    </el-card>


</div>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
   let v = new Vue({
        el: '#app',
        data: function() {

            return {
                value: [],
                options: [{
                    value: 'zhinan',
                    label: '内科',
                    children: [{
                        value: 'shejiyuanze',
                        label: '设计原则',
                        children: [{
                            value: 'yizhi',
                            label: '可预约'
                        }, {
                            value: 'fankui',
                            label: '已满'
                        },]
                    }, {
                        value: 'daohang',
                        label: '导航',
                        children: [{
                            value: 'cexiangdaohang',
                            label: '侧向导航'
                        }, {
                            value: 'dingbudaohang',
                            label: '顶部导航'
                        }]
                    }]
                }, {
                    value: 'zujian',
                    label: '外科',
                    children: [{
                        value: 'basic',
                        label: 'Basic',
                        children: [{
                            value: 'layout',
                            label: 'Layout 布局'
                        }, {
                            value: 'color',
                            label: 'Color 色彩'
                        }, {
                            value: 'typography',
                            label: 'Typography 字体'
                        }, {
                            value: 'icon',
                            label: 'Icon 图标'
                        }, {
                            value: 'button',
                            label: 'Button 按钮'
                        }]
                    }, {
                        value: 'form',
                        label: 'Form',
                        children: [{
                            value: 'radio',
                            label: 'Radio 单选框'
                        }, {
                            value: 'checkbox',
                            label: 'Checkbox 多选框'
                        }, {
                            value: 'input',
                            label: 'Input 输入框'
                        }, {
                            value: 'input-number',
                            label: 'InputNumber 计数器'
                        }, {
                            value: 'select',
                            label: 'Select 选择器'
                        }, {
                            value: 'cascader',
                            label: 'Cascader 级联选择器'
                        }, {
                            value: 'switch',
                            label: 'Switch 开关'
                        }, {
                            value: 'slider',
                            label: 'Slider 滑块'
                        }, {
                            value: 'time-picker',
                            label: 'TimePicker 时间选择器'
                        }, {
                            value: 'date-picker',
                            label: 'DatePicker 日期选择器'
                        }, {
                            value: 'datetime-picker',
                            label: 'DateTimePicker 日期时间选择器'
                        }, {
                            value: 'upload',
                            label: 'Upload 上传'
                        }, {
                            value: 'rate',
                            label: 'Rate 评分'
                        }, {
                            value: 'form',
                            label: 'Form 表单'
                        }]
                    }, {
                        value: 'data',
                        label: 'Data',
                        children: [{
                            value: 'table',
                            label: 'Table 表格'
                        }, {
                            value: 'tag',
                            label: 'Tag 标签'
                        }, {
                            value: 'progress',
                            label: 'Progress 进度条'
                        }, {
                            value: 'tree',
                            label: 'Tree 树形控件'
                        }, {
                            value: 'pagination',
                            label: 'Pagination 分页'
                        }, {
                            value: 'badge',
                            label: 'Badge 标记'
                        }]
                    }, {
                        value: 'notice',
                        label: 'Notice',
                        children: [{
                            value: 'alert',
                            label: 'Alert 警告'
                        }, {
                            value: 'loading',
                            label: 'Loading 加载'
                        }, {
                            value: 'message',
                            label: 'Message 消息提示'
                        }, {
                            value: 'message-box',
                            label: 'MessageBox 弹框'
                        }, {
                            value: 'notification',
                            label: 'Notification 通知'
                        }]
                    }, {
                        value: 'navigation',
                        label: 'Navigation',
                        children: [{
                            value: 'menu',
                            label: 'NavMenu 导航菜单'
                        }, {
                            value: 'tabs',
                            label: 'Tabs 标签页'
                        }, {
                            value: 'breadcrumb',
                            label: 'Breadcrumb 面包屑'
                        }, {
                            value: 'dropdown',
                            label: 'Dropdown 下拉菜单'
                        }, {
                            value: 'steps',
                            label: 'Steps 步骤条'
                        }]
                    }, {
                        value: 'others',
                        label: 'Others',
                        children: [{
                            value: 'dialog',
                            label: 'Dialog 对话框'
                        }, {
                            value: 'tooltip',
                            label: 'Tooltip 文字提示'
                        }, {
                            value: 'popover',
                            label: 'Popover 弹出框'
                        }, {
                            value: 'card',
                            label: 'Card 卡片'
                        }]
                    }]
                }, {
                    value: 'ziyuan',
                    label: '妇产科',
                    children: [{
                        value: 'axure',
                        label: 'Axure Components'
                    }, {
                        value: 'sketch',
                        label: 'Sketch Templates'
                    }, {
                        value: 'jiaohu',
                        label: '组件交互文档'
                    }],

                },
                    { value: 'rke',
                        label: '儿科',
                        children: [{}]}
                ],


                pickerOptions: {
                    disabledDate(time) {
                        return time.getTime() > Date.now();
                    },
                    shortcuts: [{
                        text: '今天',
                        onClick(picker) {
                            picker.$emit('pick', new Date());
                        }
                    }, {
                        text: '昨天',
                        onClick(picker) {
                            const date = new Date();
                            date.setTime(date.getTime() - 3600 * 1000 * 24);
                            picker.$emit('pick', date);
                        }
                    }, {
                        text: '一周前',
                        onClick(picker) {
                            const date = new Date();
                            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
                            picker.$emit('pick', date);
                        }
                    }]
                },
                value1: '',
                value2: '',
                isShow:true,
                dialogImageUrl: '',
                dialogVisible: false,
                p:{
                    title:"",
                    price:"",
                    oldPrice:"",
                    saleCount:"",
                    num:"",
                    categoryId:"",
                    url:""
                },
                value4:"",
                genderArr:[{value4:'nan',label:"男"},{value4:'nv',label:"女"}],
                value5:"",
                oldUrl:[{value5:'nan',label:"专家"},{value5:'nv',label:"普通医生"}],
                value6:"",
                reaistration:[{value6:'1',label:"5"},{value6:'2',label:"6.6"},{value6:'3',label:"8"}]
            }

        },
       methods:{
           handleChange(value) {
               console.log(value);
           },

           insert(){

             //发出添加商品的请求
             axios.post("/sick/registration/insert",v.p).then(function (response) {
                 //显示到管理页面
                 location.href="/admin.html";
             })
           },

           goBack(){
               history.back();//返回上一页面
           },

       }

    })
</script>
</html>